//
//  YMTravelTrackViewController.swift
//  Driver
//
//  Created by lantaiyuan on 2017/10/30.
//  Copyright © 2017年 youmy. All rights reserved.
//

import UIKit

class YMTravelTrackViewController: UIViewController {
    @IBOutlet weak var startLb: UILabel!
    @IBOutlet weak var endLb: UILabel!
    
    @IBOutlet weak var journeyLb: UILabel!
    @IBOutlet weak var hourLb: UILabel!
    @IBOutlet weak var peoplesLb: UILabel!
    @IBOutlet weak var moneyLb: UILabel!
    @IBOutlet weak var arrowBtn: UIButton!
    
    @IBOutlet weak var mapView: MAMapView!
    
    
    @IBOutlet weak var circleConstraintH: NSLayoutConstraint!
    @IBOutlet weak var circleConstraintW: NSLayoutConstraint!
    
    @IBOutlet weak var bottomViewContraintH: NSLayoutConstraint!
    
    @IBOutlet weak var arrowImageView: UIImageView!
    
    @IBAction func isOpen(_ sender: UIButton) {
        sender.isSelected = !sender.isSelected
        arrowImageView.image = UIImage(named: sender.isSelected ? "button_open" : "button_close")
        bottomViewContraintH.constant = sender.isSelected ? 120 : 0

    }
    
    override func viewDidLoad() {
        super.viewDidLoad()

        print(circleConstraintW,circleConstraintH)
        let width = (UIScreen.main.bounds.width - 75) / 4.0
        circleConstraintH.constant = width
        circleConstraintW.constant = width
        print(width)
        arrowBtn.isSelected = false
        bottomViewContraintH.constant = 0
    }
}
